import React, { useEffect,useState } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card } from 'antd';
import arouter from '@/utils/apulis-router'

import {getBasicInfo} from './service.js';

const Welcome= () => {
  // arouter({})
  const [presetModelNum,setPresetModelNum] = useState(0)
  const [userModelNum,setUserModelNum] = useState(0)

  useEffect(() => {
    getBasicInfo().then(res=>{
      console.log(res)
      if(res.code===0){
        setPresetModelNum(res.data.preset)
        setUserModelNum(res.data.published)
      }
    })
    
  }, []);
  return (
    <PageContainer>
      <div style={{display:"flex"}}>
      <Card title="预置模型"  style={{ width: 300 ,marginRight:"20px"}}>
      <p>{presetModelNum}</p>
     
    </Card>
    <Card title="用户模型"  style={{ width: 300 }}>
      <p>{userModelNum}</p>
     
    </Card>
      </div>
      
    </PageContainer>
  );
};





export default Welcome;